package com.boot.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.annotation.NameStyle;
import tk.mybatis.mapper.code.IdentityDialect;
import tk.mybatis.mapper.code.Style;
import util.FD;

@Entity
@Table(name = "t_course_comment")
@NameStyle(Style.normal)
public class CourseComment {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false, insertable = false)
	@KeySql(dialect = IdentityDialect.SQLSERVER, useGeneratedKeys = true)
	private Integer		id;
	@FD("课程")
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "courseId")
	private Course		course;
	private Integer		courseId; 
	@FD("用户")
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "userId")
	private SimpleUser	user;
	private Integer		userId;
	@FD("发表日期")
	private String		addDate;
	@FD("评分")
	@Column(updatable = false)
	private Integer		score;
	@FD("评价")
	@Column(length = 1000)
	private String		content;

	public Integer getId() {
		return id;
	}

	public Course getCourse() {
		return course;
	}

	public Integer getCourseId() {
		return courseId;
	}

	public SimpleUser getUser() {
		return user;
	}

	public Integer getUserId() {
		return userId;
	}

	public String getAddDate() {
		return addDate;
	}

	public Integer getScore() {
		return score;
	}

	public String getContent() {
		return content;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public void setCourseId(Integer courseId) {
		this.courseId = courseId;
	}

	public void setUser(SimpleUser user) {
		this.user = user;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public void setAddDate(String addDate) {
		this.addDate = addDate;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	public void setContent(String content) {
		this.content = content;
	}

}
